<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>过渡和动画</title>
  <script src="vue.js"></script>
  <link rel="stylesheet" href="css/animate.css">
  <style>
     .fade-enter,.fade-leave-to{
       opacity:0;
     }
    .fade-enter-active,.fade-leave-active{
      transition: opacity 1s;
    }
  </style>
</head>
<body>
<!--appear与appear-active-class实现了页面的初次动画-->
<!--animated swing、 fade-enter-active==》 transition与keyframes的融合使用-->
<!--过渡时长与cs3动画时间两者的主导  可由type设置  或者直接用:duration来设计所有时长-->
<div id="app">
  <!--:duration="{enter:5000,leave:10000}"-->
  <!--:duration="5000"-->
  <transition
      :duration="{enter:5000,leave:7000}"
      type="transition"
      name="fade" appear
                enter-active-class="animated swing fade-enter-active"
                leave-active-class="animated shake fade-leave-active"
                appear-active-class="animated swing" >
        <div v-show="show">hello world</div>
    </transition>
    <button @click="handelBtnClick">change</button>
</div>
<script>
  var vm=new Vue({
    el:"#app",
    data:{
        show:true
    },
    methods:{
      handelBtnClick:function(){
           this.show=!this.show
      }
    }
  })
</script>
</body>
</html>
